package com.yuezhu.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;


import com.yuezhu.global.BaseFragment;
import com.yuezhu.R;
import com.yuezhu.been.DataChangedEvent;
import com.yuezhu.constomview.MyView;
import com.yuezhu.constomview.TitleView;
import com.yuezhu.util.DateUtil;
import com.yuezhu.util.LogUtils;
import com.yuezhu.util.MyToast;
import com.yuezhu.versionup.VersionCheckUtil;

import org.greenrobot.eventbus.Subscribe;


/**
 * @创建人：zhaoshuzhen
 * @创建时间：2016/1/18 11:46
 */
public class MyFragment extends BaseFragment implements OnClickListener, VersionCheckUtil.VersionCheckResult {
    private TitleView titleView;
    MyView myview;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_my, container, false);
        initview(view);
        setLiseners();
        initData();
        return view;
    }

    @Override
    public void initview(View view) {
        titleView = (TitleView) view.findViewById(R.id.title);
        titleView.initTitleContent("", "我的", "", null).setStaus(TitleView.MID);
        myview = (MyView) view.findViewById(R.id.myview);
        myview.setMyViewListener(this);
        initData();
    }

    private void initData() {

    }

    @Override
    public void setLiseners() {

    }

    @Override
    public void onClick(View v) {
        if (DateUtil.isFastClick()) {
            return;
        }
        switch (v.getId()) {
            case R.id.my_all:
                MyToast.showDefaltToast("全部");
                break;
            case R.id.my_has:
                MyToast.showDefaltToast("已缴");
                break;
            case R.id.my_no:
                MyToast.showDefaltToast("未缴");
                break;

        }
    }

//    @Subscribe
//    // 订阅事件DataChangedEvent
//    public void setCardEvent(DataChangedEvent event) {
//        LogUtils.e("event", "setCardEvent");
//    }

    @Override
    public void verCheckRes() {
        MyToast.showDefaltToast("当前版本为最新版本");
    }

    public void onResume() {
        super.onResume();
    }

    public void onPause() {
        super.onPause();
    }

}
